package com.five.service.impl;

import com.five.dao.UserBusinessActivitiesMapper;
import com.five.entity.UserBusinessActivities;
import com.five.service.UserBusinessActivitiesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/2/26.
 */
@Service("UserBusinessActivitiesService")
public class UserBusinessActivitiesServiceImpl implements UserBusinessActivitiesService {

    @Autowired
    private UserBusinessActivitiesMapper userBusinessActivitiesMapper;

    @Override
    public void addUserBusinessActivities(UserBusinessActivities userBusinessActivities) {
        userBusinessActivitiesMapper.insertSelective(userBusinessActivities);
    }

    @Override
    public List<UserBusinessActivities> selectUserBusinessActivities(Integer businessActivitiesId) {
        return userBusinessActivitiesMapper.selectUserBusinessActivities(businessActivitiesId);
    }

    @Override
    public int findGroupPersonNumber(Integer businessActivitiesId) {
        return userBusinessActivitiesMapper.selectGroupPersonNumber(businessActivitiesId);
    }

    @Override
    public UserBusinessActivities selectByUserIdAndBusinessActivityId(Integer userId, Integer businessActivitiesId) {
        return userBusinessActivitiesMapper.selectByUserIdAndBusinessActivityId(userId, businessActivitiesId);
    }

    @Override
    public void updateStatus(UserBusinessActivities userBusinessActivities) {
        userBusinessActivitiesMapper.updateByPrimaryKeySelective(userBusinessActivities);
    }

    @Override
    public List<UserBusinessActivities> selectByUserId(Integer userId) {
        return userBusinessActivitiesMapper.selectByUserId(userId);
    }

}
